package com.example.rjb_shoping.consumer;

import com.example.rjb_shoping.service.RjbOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.xq.softcup.mq.client.consumer.IMqConsumer;
import org.xq.softcup.mq.client.consumer.annotation.MqConsumer;
import org.xq.softcup.mq.client.util.MqResult;

import javax.annotation.Resource;

/**
 * 订单消费者
 * @MqConsumer 是消费者注解
@MqConsumer(topic = "topic_o", group = MqConsumer.DEFAULT_GROUP)
@Service */
@Slf4j
public class OrderConsumer implements IMqConsumer {

    /**
     * 消费订单方法
     * @param s
     * @return
     * @throws Exception
     */
    @Override
    public MqResult consume(String s) throws Exception {
        log.info("消息:{}", s);
        return MqResult.SUCCESS;
    }
}
